#ifndef WIIMOTE_H
#define WIIMOTE_H

#include <iostream>
#include <wiiuse.h>
#include <fstream>
#include <stdlib.h>

#define WITH_RUMBLE 0x01
#define WITHOUT_RUMBLE 0x02
#define SHUTDOWN 0x03
#define DISCONNECT 0x04

typedef int status;

class wmote {
    public:
        wmote();
        ~wmote();

        status connect();
        void discconnect(int opt = SHUTDOWN);
        void set_leds(int opt = WITH_RUMBLE);
        void set_motion_sensing(int opt = 1);
        void set_orient_threshold(float num = 0.5);
        void set_IR(int active = 1, int sense = 3); //sense -> 1 lowest , 5 highest
        void set_IR_opts(enum aspect_t aspect = WIIUSE_ASPECT_16_9, enum ir_position_t position = WIIUSE_IR_ABOVE, uint x = 1920, uint y = 1080);

    private:
        int num;
        wiimote_t **wm;

    friend class driver;
};

struct config {
    int num_wm;
    int rumble;
    int motion_s;
    float orient_thr;
    int active_IR;
    int sense;
    aspect_t aspect;
    ir_position_t position;
    uint x;
    uint y;
};

#endif // WIIMOTE_H
